import { GameConfig } from "./GameConfig";

export class RoomJinbiConfig {

    public level: number = 1; //场次
    public difen: number = 0; //底分
    public enterMin: number = 0; //入场最低携带
    public serve: number = 0; //服务费
    public online: number = 0; //在线
    public minCharge: number = 0; //最低多少金币

    public static jinbiConfigList: Array<RoomJinbiConfig> = [

    ]

    public static paodekuai_jinbichangList: Array<RoomJinbiConfig> = [

    ]

    public static ziyouchang_list: Array<RoomJinbiConfig> = [
    ]



    constructor(level: number, difen: number, enterMin: number, serve: number, online: number, minCharge:number=0) {
        this.level = level;
        this.difen = difen
        this.enterMin = enterMin
        this.serve = serve
        this.online = online
        this.minCharge = minCharge
    }



    public static json2JinbiConfigList(dataList: Array<object>) {
        this.jinbiConfigList = []
        for (let i = 0; i < dataList.length; i++) {
            this.jinbiConfigList[i] = new RoomJinbiConfig(dataList[i]["level"], dataList[i]["difen"], dataList[i]["enterMin"], dataList[i]["serve"], dataList[i]["online"])
        }
    }


    public static json2paodekuai_jinbichangList(dataList: Array<object>) {
        this.paodekuai_jinbichangList = []
        for (let i = 0; i < dataList.length; i++) {
            this.paodekuai_jinbichangList[i] = new RoomJinbiConfig(dataList[i]["level"], dataList[i]["difen"], dataList[i]["enterMin"], dataList[i]["serve"], dataList[i]["online"])
        }
    }

    public static json2_ziyouchang_list(dataList: Array<object>){
        this.ziyouchang_list = []
        for (let i = 0; i < dataList.length; i++) {
            this.ziyouchang_list[i] = new RoomJinbiConfig(dataList[i]["level"], dataList[i]["difen"], dataList[i]["enterMin"],
             dataList[i]["serve"], dataList[i]["online"], dataList[i]["minCharge"])
        }
    }

}